package lgs.hm.homework.work2;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@Component
public class Driver {
	
	private String name="老王";
	private String Native="北京";
	private Integer phone=7758258;
	@Autowired
	private Car car;
	
	@Autowired  //根据类型注入，当有多个类型的情况下会出问题
	@Qualifier("secretary")  //根据名称注入
	private Secretary wife;
	
	public Driver() {}

	public Driver(String name, Integer phone, Car car) {
		this.name = name;
		this.phone = phone;
		this.car = car;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getNative() {
		return Native;
	}

	public void setNative(String native1) {
		Native = native1;
	}

	public Integer getPhone() {
		return phone;
	}

	public void setPhone(Integer phone) {
		this.phone = phone;
	}

	public Car getCar() {
		return car;
	}

	public void setCar(Car car) {
		this.car = car;
	}

	@Override
	public String toString() {
		return "Driver [name=" + name + ", Native=" + Native + ", phone=" + phone + ", car=" + car + ", wife=" + "妻子"
				+ "]";
	}
	

}
